package cn.wawi.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.wawi.entity.data.Post;

public class JsonUtil {

	public static List<Map<String,Object>> getPost(List<Post> list,List<Post> list1){
		List<Map<String,Object>> trees=new ArrayList<Map<String,Object>>();
        for (Post p1: list) {
        	Map<String,Object> m=new HashMap<String,Object>();
        	m.put("id", p1.getPostId());
        	m.put("text", p1.getPostName());
        	m.put("checked", false);
        	if(list1.contains(p1)){
        		m.put("checked", true);
        	}
        	trees.add(m);
		}
		return trees;
	}
}
